import { buildOneHapAndCheckFile } from '../../plugins/common-fun';
import {
  AbilityType,
  APIType,
  APIVersion,
  CaseLevel,
  IsEnable,
  LanguageType,
  ModuleTemplateType,
  RuntimeOSType,
  SDKType,
  SignType
} from '../../plugins/project-builder/models/constants';
import { TestCaseBuilder } from '../../plugins/task-builder/task-case-builder';
import { ProjectBuildOption } from '../../plugins/task-builder/test-case';
import { TestTaskOption } from '../../plugins/task-builder/test-task-option';


const projectBuilderOption: ProjectBuildOption = {
  template: {
    sdk: SDKType.Single,
    runtimeOS: RuntimeOSType.HarmonyOS,
    apiVersion: APIVersion.API10,
    apiType: APIType.STAGE,
    language: LanguageType.ArkTs,
    abilityType: AbilityType.Application,
    entryTemplateType: ModuleTemplateType.NativeC
  },

  modulesOption: {
    [ModuleTemplateType.NativeC]: 1,
  }
};

const taskConfig: TestTaskOption = {
  caseLevel: CaseLevel.L1,
  sign: SignType.Sign,
  ohpmInstall: IsEnable.Enable,
};

// 将demo测试用例注册到测试用例中心
TestCaseBuilder.builder()
  .caseName('OPEN_LAB_ZOS_HOS_Build_ArkTs_Service_Widge_api10_003')
  .description('Cpp工程支持arkts卡片编译打包')
  .projectBuilderOption(projectBuilderOption)
  .taskConfig(taskConfig)
  .testFun(buildOneHapAndCheckFile('entry'))
  .load();
